package 定时任务;

import java.util.concurrent.DelayQueue;

/**
 * 作者：idea
 * 日期：2018/8/1
 * 描述：
 */
public class Test {
    public static void main(String[] args) {
        DelayQueue<Message> queue=new DelayQueue<Message>();
        Message m1=new Message(1,"world",2);
        Message m2=new Message(2,"world",5);
        queue.offer(m2);
        queue.offer(m1);
        new Thread(new Consumer(queue)).start();
    }
}
